Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag to ls to not resolve type of subnodes #2824

Merged
merged 3 commits into from
Jun 28, 2016
Merged

Conversation

Kubuxu
Copy link
Member

@Kubuxu Kubuxu commented Jun 8, 2016

This makes ls return even if files referenced in the directory are not available.
It also introduces a resolve-type flag that forces the resolution of type.

Resolves #2820

License: MIT
Signed-off-by: Jakub Sztandera [email protected]

@Kubuxu Kubuxu added the need/review Needs a review label Jun 8, 2016
@Kubuxu Kubuxu mentioned this pull request Jun 8, 2016
@whyrusleeping
Copy link
Member

I don't like this, it can silently provide misleading information. I think that we could move the type query under a flag (or have a flag to disable it).

@Kubuxu
Copy link
Member Author

Kubuxu commented Jun 8, 2016

As it is an int, maybe I will make it -1 when it could not be resolved, as an error code.

@Kubuxu
Copy link
Member Author

Kubuxu commented Jun 9, 2016

How does it look now?

@whyrusleeping
Copy link
Member

@Kubuxu I just don't like the possiblity of returning partial data. It feels kinda wrong to me...

@Kubuxu
Copy link
Member Author

Kubuxu commented Jun 9, 2016

Then IMO we should remove this from API completely (maybe only with special flag), as it has quite high drawback for such small benefit in usual use case (someone doing ipfs ls).

@whyrusleeping
Copy link
Member

Yeah, thats what i meant by moving the type query under a flag.

@Kubuxu Kubuxu force-pushed the feature/ls-stuck branch 2 times, most recently from b9f4952 to 3972d99 Compare June 9, 2016 22:51
@Kubuxu
Copy link
Member Author

Kubuxu commented Jun 10, 2016

@whyrusleeping what is the correct way to getting a object if and only if it is local?

@whyrusleeping
Copy link
Member

@Kubuxu use the blockstore (not blockservice) directly. Or construct a new dagservice with an 'offline' exchange

@Kubuxu Kubuxu added status/in-progress In progress and removed need/review Needs a review labels Jun 11, 2016
Kubuxu added 2 commits June 13, 2016 14:04
Add option to resolve type using ls but
set it to false by default.

License: MIT
Signed-off-by: Jakub Sztandera <[email protected]>
License: MIT
Signed-off-by: Jakub Sztandera <[email protected]>
@Kubuxu Kubuxu force-pushed the feature/ls-stuck branch from 3972d99 to 399ff38 Compare June 13, 2016 13:13
@Kubuxu Kubuxu changed the title Add timeout to ls so it doesn't hang indefinatelly Change default behaviour of ls not to resolve type of subnodes Jun 14, 2016
@Kubuxu
Copy link
Member Author

Kubuxu commented Jun 14, 2016

Ok, now it doesn't resolve the subnode data unless the data is available locally.
There is also a flag to force resolution.

@RichardLitt this changes API.

@Kubuxu Kubuxu added need/review Needs a review and removed status/in-progress In progress labels Jun 14, 2016
@whyrusleeping
Copy link
Member

@Kubuxu i'd like this to default to true, so we maintain compatibility with our existing behaviour

License: MIT
Signed-off-by: Jakub Sztandera <[email protected]>
@Kubuxu Kubuxu changed the title Change default behaviour of ls not to resolve type of subnodes Add flag to ls to not resolve type of subnodes Jun 21, 2016
@Kubuxu
Copy link
Member Author

Kubuxu commented Jun 21, 2016

Done

@Kubuxu Kubuxu added this to the Ipfs 0.4.3 milestone Jun 22, 2016
@whyrusleeping whyrusleeping merged commit d72c9fc into master Jun 28, 2016
@whyrusleeping whyrusleeping deleted the feature/ls-stuck branch June 28, 2016 19:06
@RichardLitt
Copy link
Member

@Kubuxu How do I use resolve-type in a curl request? Any ideas?

res.SetError(err, cmds.ErrNormal)
return
}
linkNode, err = merkledag.DecodeProtobuf(b.Data())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok wat-- all this merkledag code shouldnt have to be out here. this should all be handled by util functions in either unixfs or some other package. this is leaking abstractions out

@Kubuxu Kubuxu self-assigned this Aug 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/review Needs a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ipfs ls gets stuck
4 participants